package com.iceland.common.util;

//import com.iceland.testserver.server.ProxyServer;
//import com.iceland.testserver.server.Server;

import com.iceland.common.rpc.RpcMessageManager;
import io.netty.channel.Channel;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class ChannelContext {

    //绑定的channel
    Channel bindChannel;
    RpcMessageManager rpcMessageManager;
    Map<String,Object> map=new ConcurrentHashMap<>();


    public ChannelContext(RpcMessageManager rpcMessageManager, Channel bindChannel){
        this.rpcMessageManager=rpcMessageManager;
        this.bindChannel=bindChannel;
    }
    //绑定的代理服务器
//    ProxyServer bindProxyServer;

    public Channel getBindChannel() {
        return bindChannel;
    }

    public void setBindChannel(Channel bindChannel) {
        this.bindChannel = bindChannel;
    }

//    public <T> T getBindProxyServer() {
//        return (T)(map.get(ProxyServer));
//    }
//
//    public void setBindProxyServer(Object bindProxyServer) {
//        map.put(ProxyServer,bindProxyServer);
//    }

    public void setRpcMessageManager(RpcMessageManager rpcMessageManager) {
        this.rpcMessageManager=rpcMessageManager;
    }

    public RpcMessageManager getRpcMessageManager() {
        return rpcMessageManager;
    }

//    @Override
//    public <T> T getCmdClient() {
//        return (T)map.get(CmdClient);
//    }
//
//    @Override
//    public void setCmdClient(Object cmdClient) {
//        map.put(CmdClient,cmdClient);
//    }

//    @Override
//    public <T> T getProxyClient() {
//        return (T)map.get(ProxyClient);
//    }
//
//    @Override
//    public void setProxyClient(Object proxyClient) {
//        map.put(ProxyClient,proxyClient);
//    }


//    public ProxyServer getBindProxyServer() {
//        return bindProxyServer;
//    }
//
//    public void setBindProxyServer(ProxyServer bindProxyServer) {
//        this.bindProxyServer = bindProxyServer;
//    }


}
